Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move ConfigOptions to core #4803

Merged
merged 5 commits into from
Jan 4, 2023
Merged

Conversation

tustvold
Copy link
Contributor

@tustvold tustvold commented Jan 3, 2023

Which issue does this PR close?

Part of #4349

Rationale for this change

Moves ConfigOptions to common so it can be used directly by the optimizer, planner, etc... greatly simplifying plumbing configuration around the place

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@tustvold tustvold added the api change Changes the API exposed to users of the crate label Jan 3, 2023
@github-actions github-actions bot added core Core DataFusion crate optimizer Optimizer rules sql SQL Planner labels Jan 3, 2023
@@ -47,3 +47,4 @@ object_store = { version = "0.5.0", default-features = false, optional = true }
parquet = { version = "29.0.0", default-features = false, optional = true }
pyo3 = { version = "0.17.1", optional = true }
sqlparser = "0.29"
num_cpus = "1.13.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only slight downside, but I'm inclined to think this isn't a big deal

@github-actions github-actions bot added the sqllogictest SQL Logic Tests (.slt) label Jan 3, 2023
@@ -92,9 +92,12 @@ pub struct OptimizerContext {
impl OptimizerContext {
/// Create optimizer config
pub fn new() -> Self {
let mut options = ConfigOptions::default();
options.optimizer.filter_null_join_keys = true;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I double-checked this wasn't introduced by the recent config rework, and confirmed that it has always been the case that OptimizerContext defaults this to true, but ConfigOptions defaults it to false.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My intention was always to have this default to false so this looks like a bug

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OptimizerContext is now only used within tests, and so I am going to leave this for now. If you feel strongly I can file a follow up PR to change this, but it creates a non-trivial amount of test-churn

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👨‍🍳 👌

Looks very nice to me @tustvold -- thank you

@@ -17,7 +17,7 @@

//! DataFusion Configuration Options

use datafusion_common::{DataFusionError, Result};
use crate::{DataFusionError, Result};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

) -> Result<Option<LogicalPlan>> {
if !config.options().optimizer.filter_null_join_keys {
return Ok(None);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it is worth a debug! here if this is skipped

@@ -91,28 +85,25 @@ pub struct OptimizerContext {
/// Query execution start time that can be used to rewrite
/// expressions such as `now()` to use a literal value instead
query_execution_start_time: DateTime<Utc>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice

@tustvold tustvold merged commit e1dc962 into apache:master Jan 4, 2023
@ursabot
Copy link

ursabot commented Jan 4, 2023

Benchmark runs are scheduled for baseline = ae1465d and contender = e1dc962. e1dc962 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api change Changes the API exposed to users of the crate core Core DataFusion crate optimizer Optimizer rules sql SQL Planner sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants